package com.demo.zlb.sso.login.controller;

import com.demo.zlb.sso.login.server.impl.DingServerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shiyuchen
 * @date 2023-04-121
 */
@RestController
@RequestMapping("/ding")
public class DingController {

    @Autowired
    private DingServerImpl dingServer;

    @GetMapping("/company")
    public String getPropertiesByOrgTypeCode(@RequestParam("code") String code) {
        return dingServer.getPropertiesByOrgTypeCode(code).toString();
    }

    @GetMapping("/employee")
    public String pageOrganizationEmployeeCodes(@RequestParam("page") String page,
                                                @RequestParam("curPage") String curPage,
                                                @RequestParam("code") String code) {
        return dingServer.pageOrganizationEmployeeCodes(page, curPage, code);
    }
}
